<div id="{$Think.CONTROLLER_NAME}_{$Think.ACTION_NAME}_popup_menu" style="width:150px;"> </div>

<script language="javascript">
    $(document).ready(function () {
        console.log('-- emp_app/view/pc/user/emp_gui_adm/index/popup_menu.html');

        var index = new Page({
            Module: '{$Think.MODULE_NAME}',
            Controller: '{$Think.CONTROLLER_NAME}',
            Action: '{$Think.ACTION_NAME}',
        });

        // 创建popup_menu
        index.menu().menu_item(index.data.Popup_Menu, 'popup_menu');
        // 单独的每项菜单的功能
        index.popup_menu = {
            adm_script: function (item) {
                console.log('adm_script run');
                var url = item.target.attributes['url'].value;
                url = index.url().add_param(url, index.data.Script.adm);
                url = index.url().add_param(url, index.url_children);
                index.Fun_Win.window({
                    inline: true,
                    title: index.data.Script.adm.obj_id + ' ' + item.text,
                    minimizable: false,
                    maximizable: false,
                    width: 920,
                    height: 500,
                    modal: true,
                    href: url,
                });
                index.open_win_id = item.text;
            },
            record_script: function (item) {
                console.log('record_script run');
                var url = item.target.attributes['url'].value;
                url = index.url().add_param(url, index.data.Script.record);
                url = index.url().add_param(url, index.url_children);
                index.Fun_Win.window({
                    inline: true,
                    title: index.data.Script.record.obj_id + ' ' + item.text,
                    minimizable: false,
                    maximizable: false,
                    width: 920,
                    height: 500,
                    modal: true,
                    href: url,
                });
                index.open_win_id = item.text;
            },
        };
        // 将点击菜单下拉功能时，下上面定义的功能进行调用绑定
        index.menu().menu_item_click_bind(index.data.Popup_Menu, 'popup_menu');

        // 标识主功能菜单构建完成
        index.gui_build_state.Popup_Menu = true;
    });
</script>
